package com.tgy.vo;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.time.LocalDateTime;
import java.util.List;

/**
 * 评论返回格式
 * @author tianguiyin
 * @version 1.0
 * @date 2022/7/20 15:14
 */
@Data
@ApiModel(value = "评论数据返回对象",description = "")
public class CommentVo {
    @ApiModelProperty(value = "评论ID")
    private String commentId;
    @ApiModelProperty(value = "文章ID")
    private String article;
    @ApiModelProperty(value = "评论用户")
    private CommentUser user;
    @ApiModelProperty(value = "评论内容")
    private String content;
    @ApiModelProperty(value = "评论时间")
    private String commentDate;
    @ApiModelProperty(value = "评论地点")
    private String site;
    @ApiModelProperty(value = "回复评论列表")
    private List<CommentVo> reply;


    @Data
    @ApiModel(value = "评论用户信息",description = "")
    public static class CommentUser{
        @ApiModelProperty(value = "用户的ID")
        private String userId;
        @ApiModelProperty(value = "用户昵称")
        private String nickname;
        @ApiModelProperty(value = "用户头像")
        private String headPortrait;
        @ApiModelProperty(value = "用户性别")
        private String sex;
        @ApiModelProperty(value = "注册时间")
        private LocalDateTime registrationDate;
        @ApiModelProperty(value = "最后一次登录时间")
        private LocalDateTime latelyLoginTime;
        @ApiModelProperty(value = "数字")
        private Integer commentNum;
    }

    @Data
    @ApiModel(value = "回复评论对象",description = "")
    public static class CommentReply{
        @ApiModelProperty(value = "当前评论的ID")
        private String replyId;
        @ApiModelProperty(value = "回复评论的对象")
        private CommentVo comment;
        @ApiModelProperty(value = "回复人")
        private CommentUser user;
        @ApiModelProperty(value = "回复内容")
        private String content;
        @ApiModelProperty(value = "回复时间")
        private LocalDateTime replyDate;
        @ApiModelProperty(value = "回复地点")
        private Integer site;
    }
}
